package com.longjianghuasheng.logistics.business.home.adapter

import androidx.core.view.isVisible
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.longjianghuasheng.logistics.R
import com.longjianghuasheng.logistics.business.home.News
import com.longjianghuasheng.logistics.databinding.ItemNewsBinding

class NewsAdapter :
    BaseQuickAdapter<News, BaseDataBindingHolder<ItemNewsBinding>>(R.layout.item_news) {

    override fun convert(holder: BaseDataBindingHolder<ItemNewsBinding>, item: News) {
        holder.dataBinding?.run {

            tvTitle.isVisible = holder.layoutPosition == 0

            tvNews.text = item.title

            tvDate.text = item.create_time


        }
    }
}